//
//  DZWebTableViewCell.m
//  DaZhePrivateHomeCuisineClient
//
//  Created by zouzhisheng on 15/4/1.
//  Copyright (c) 2015年 zouzhisheng. All rights reserved.
//

#import "DZWebTableViewCell.h"
#import "DZPrivateDetailViewController.h"
@implementation DZWebTableViewCell

- (void)awakeFromNib {
    // Initialization code
     //self.dzWebView.scrollView.bounces=NO;
     self.dzWebView.height=SCREEN_HEIGHT-160-64;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)loadWebView:(NSString *)webStr{
    self.dzWebView.delegate=self;
    [self.dzWebView loadHTMLString:webStr baseURL:nil];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    CGRect frame = webView.frame;
    CGSize fittingSize = [webView sizeThatFits:CGSizeZero];
    frame.size = fittingSize;
    webView.frame = frame;
    self.dzWebView.height=frame.size.height+25;
    DZPrivateDetailViewController *vc=(DZPrivateDetailViewController*)[self viewController];
    [vc reloadTableViewHeight:frame.size.height];
    
}
- (UIViewController*)viewController {
    for (UIView* next = [self superview]; next; next =
         next.superview) {
        UIResponder* nextResponder = [next nextResponder];
        if ([nextResponder isKindOfClass:[UIViewController
                                          class]]) {
            return (UIViewController*)nextResponder;
        }
    }
    return nil;
}

@end
